package pres.lnk.learn.designpattern.d_builder;

/**
 * <p>建造者模式</p>
 * 解决创建一个复杂对象
 * @Author lnk
 * @Date 2018/2/1
 */
public class Main {
    public static void main(String[] args) {
        MealBuilder builder = new MealBuilder();

        //点蔬菜汉堡套餐（获取一个复杂产品）
        Meal meal = builder.prepareVegMeal();
        System.out.println("蔬菜汉堡套餐");
        meal.showItems();
        System.out.println("金额：" + meal.getCost());

        System.out.println();

        //点鸡肉汉堡套餐（获取一个复杂产品）
        meal = builder.prepareChickenMeal();
        System.out.println("鸡肉汉堡套餐");
        meal.showItems();
        System.out.println("金额：" + meal.getCost());
    }
}
